-
Notifications
You must be signed in to change notification settings - Fork 67
SWIFT-221 Provide better consistency around Int usage with Documents #235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
kmahar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good overall, just some suggestions and questions.
kmahar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm! this was a very tricky API to think through, great job 👏
mbroadst
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, great job!
SWIFT-221
This PR changes the way integers are read from and written with
Document.On 64-bit systems:
Int32Int32will be written to BSON int32IntInt64will be written to BSON int64Intwill be written to BSON int64On 32-bit systems:
IntInt32will be written to BSON int32Int64Int64will be written to BSON int64Intwill be written to BSON int32This has the notable effect that
Intwill always be round tripped, though it will be in a size according to the cpu arch.Also as part of this PR, the protocol
BSONNumberwas introduced. All numeric values that conform toBSONValueshould conform toBSONNumberas well. It facilitates conversion to the numeric types that have native representations in BSON.